Application-specific virtualized graphics processing

ABSTRACT

Methods, systems, and computer-readable media for application-specific virtualized graphics processing are disclosed. A virtual compute instance is provisioned from a provider network. The provider network comprises a plurality of computing devices configured to implement a plurality of virtual compute instances with multi-tenancy. A virtual GPU is attached to the virtual compute instance. The virtual GPU is selected based at least in part on requirements of an application. The virtual GPU is implemented using a physical GPU, and the physical GPU is accessible to the virtual compute instance over a network. The application is executed using the virtual GPU on the virtual compute instance.

BACKGROUND

Many companies and other organizations operate computer networks thatinterconnect numerous computing systems to support their operations,such as with the computing systems being co-located (e.g., as part of alocal network) or instead located in multiple distinct geographicallocations (e.g., connected via one or more private or publicintermediate networks). For example, distributed systems housingsignificant numbers of interconnected computing systems have becomecommonplace. Such distributed systems may provide back-end services toservers that interact with clients. Such distributed systems may alsoinclude data centers that are operated by entities to provide computingresources to customers. Some data center operators provide networkaccess, power, and secure installation facilities for hardware owned byvarious customers, while other data center operators provide “fullservice” facilities that also include hardware resources made availablefor use by their customers. As the scale and scope of distributedsystems have increased, the tasks of provisioning, administering, andmanaging the resources have become increasingly complicated.

The advent of virtualization technologies for commodity hardware hasprovided benefits with respect to managing large-scale computingresources for many clients with diverse needs. For example,virtualization technologies may allow a single physical computing deviceto be shared among multiple users by providing each user with one ormore virtual machines hosted by the single physical computing device.Each such virtual machine may be a software simulation acting as adistinct logical computing system that provides users with the illusionthat they are the sole operators and administrators of a given hardwarecomputing resource, while also providing application isolation andsecurity among the various virtual machines. With virtualization, thesingle physical computing device can create, maintain, or delete virtualmachines in a dynamic manner.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an example system environment for virtualizinggraphics processing in a provider network, according to one embodiment.

FIG. 2A illustrates further aspects of the example system environmentfor virtualizing graphics processing in a provider network, includingselection of an instance type and virtual GPU class for a virtualcompute instance with an attached virtual GPU, according to oneembodiment.

FIG. 2B illustrates further aspects of the example system environmentfor virtualizing graphics processing in a provider network, includingprovisioning of a virtual compute instance with an attached virtual GPU,according to one embodiment.

FIG. 3 illustrates the use of a virtual compute instance with a virtualGPU to generate virtual GPU output for display on a client device,according to one embodiment.

FIG. 4 illustrates an example hardware architecture for implementingvirtualized graphics processing, according to one embodiment.

FIG. 5 is a flowchart illustrating a method for virtualizing graphicsprocessing in a provider network, according to one embodiment.

FIG. 6A illustrates an example system environment forapplication-specific virtualized graphics processing, includingselection of a virtual GPU based (at least in part) on requirements foran application, according to one embodiment.

FIG. 6B illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingprovisioning of a virtual compute instance with an application-specificvirtual GPU attached, according to one embodiment.

FIG. 7A illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingselection of a plurality of virtual GPUs based (at least in part) onrequirements for a plurality of applications, according to oneembodiment.

FIG. 7B illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingprovisioning of a virtual compute instance with a plurality ofapplication-specific virtual GPUs attached, according to one embodiment.

FIG. 7C illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingprovisioning of a virtual compute instance with a plurality ofapplication-specific virtual GPUs dedicated to a single application,according to one embodiment.

FIG. 8 is a flowchart illustrating a method for providingapplication-specific virtualized graphics processing, according to oneembodiment.

FIG. 9A illustrates an example system environment for local-to-remotemigration for virtualized graphics processing, including provisioning ofa virtual compute instance with a local GPU, according to oneembodiment.

FIG. 9B illustrates further aspects of the example system environmentfor local-to-remote migration for virtualized graphics processing,including the selection and attachment of a virtual GPU to the virtualcompute instance, according to one embodiment.

FIG. 10 is a flowchart illustrating a method for local-to-remotemigration of graphics processing from a local GPU to a virtual GPU,according to one embodiment.

FIG. 11 illustrates an example computing device that may be used in someembodiments.

While embodiments are described herein by way of example for severalembodiments and illustrative drawings, those skilled in the art willrecognize that embodiments are not limited to the embodiments ordrawings described. It should be understood, that the drawings anddetailed description thereto are not intended to limit embodiments tothe particular form disclosed, but on the contrary, the intention is tocover all modifications, equivalents and alternatives falling within thespirit and scope as defined by the appended claims. The headings usedherein are for organizational purposes only and are not meant to be usedto limit the scope of the description or the claims. As used throughoutthis application, the word “may” is used in a permissive sense (i.e.,meaning “having the potential to”), rather than the mandatory sense(i.e., meaning “must”). Similarly, the words “include,” “including,” and“includes” mean “including, but not limited to.”

DETAILED DESCRIPTION OF EMBODIMENTS

Various embodiments of methods, systems, and computer-readable media forapplication-specific virtualized graphics processing are described.Using the techniques described herein, a virtual compute instance may beprovisioned. The virtual compute instance may be configured to executean application. The application may be associated with graphicsrequirements. For example, an application manifest may specify arecommended graphics processing unit (GPU) class and/or size of videomemory for the application, or analysis of execution of the applicationmay determine graphics requirements for the application. A virtual GPUmay be selected for the virtual compute instance based (at least inpart) on the graphics requirements for the application. The virtual GPUmay be selected from a set of virtual GPUs (e.g., belonging to virtualGPU classes) having different capabilities for graphics processing. Thevirtual GPU may be implemented using a physical GPU that is connected tothe virtual compute instance over a network. The application may beexecuted on the virtual compute instance using the virtual GPU.Additional applications on the virtual compute instance may usedifferent application-specific virtual GPUs, and theapplication-specific virtual GPUs may vary in graphics processingcapabilities based on the varying requirements of the applications.

Various embodiments of methods, systems, and computer-readable media forlocal-to-remote migration for virtualized graphics processing aredescribed. Using the techniques described herein, a virtual computeinstance may be provisioned with a local graphics processing unit (GPU)to provide graphics processing. The local GPU may be implemented usingattached hardware or using emulation. Because the local GPU may provideonly a low level of graphics processing capability, a virtual GPU may beattached to the virtual compute instance to provide improved graphicsprocessing relative to the local GPU. The virtual GPU may be selectedfrom a set of virtual GPUs (e.g., belonging to virtual GPU classes)having different capabilities for graphics processing. The virtual GPUmay be implemented using a physical GPU that is connected to the virtualcompute instance over a network. Graphics processing for the virtualcompute instance may be migrated from the local GPU to the virtual GPU.In one embodiment, graphics processing for a particular application onthe virtual compute instance may be migrated from the local GPU to thevirtual GPU during execution of the application. In one embodiment, themigration of graphics processing may be performed based (at least inpart) on detection of an increase in graphics workload.

Virtualized Graphics Processing in a Provider Network

FIG. 1 illustrates an example system environment for virtualizinggraphics processing in a provider network, according to one embodiment.Clients of a provider network 100 may use computing devices such asclient devices 180A-180N to access an elastic graphics service 110 andother resources offered by the provider network. The client devices180A-180N may be coupled to the provider network 100 via one or morenetworks 190. The provider network 100 may provide computevirtualization 140 such that a plurality of virtual compute instances141A-141Z may be implemented using a plurality of physical computeinstances 142A-142N. The virtual compute instances 141A-141Z may also bereferred to herein as virtual machines (VMs). Similarly, the providernetwork 100 may provide GPU virtualization 150 such that a plurality ofvirtual GPUs 151A-151Z may be implemented using a plurality of physicalGPUs 152A-152N. An example hardware architecture for implementingvirtual GPUs using physical GPUs is discussed with reference to FIG. 5.The underlying physical compute instances 142A-142N may beheterogeneous, and the underlying physical GPUs 152A-152N may beheterogeneous as well. In one embodiment, the compute virtualization 140may use techniques for multi-tenancy to provision virtual computeinstances 141A-141Z that exceed the physical compute instances 142A-142Nin number. In one embodiment, the GPU virtualization 150 may usetechniques for multi-tenancy to provision virtual GPUs 151A-151Z thatexceed the physical GPUs 152A-152N in number.

The elastic graphics service 110 may offer, to clients, selection andprovisioning of virtualized compute instances with attached virtualizedGPUs. Accordingly, the elastic graphics service 110 may include aninstance type selection functionality 120 and an instance provisioningfunctionality 130. In one embodiment, the provider network 100 may offervirtual compute instances 141A-141Z with varying computational and/ormemory resources. In one embodiment, each of the virtual computeinstances 141A-141Z may correspond to one of several instance types. Aninstance type may be characterized by its computational resources (e.g.,number, type, and configuration of central processing units [CPUs] orCPU cores), memory resources (e.g., capacity, type, and configuration oflocal memory), storage resources (e.g., capacity, type, andconfiguration of locally accessible storage), network resources (e.g.,characteristics of its network interface and/or network capabilities),and/or other suitable descriptive characteristics. Using the instancetype selection functionality 120, an instance type may be selected for aclient, e.g., based (at least in part) on input from the client. Forexample, a client may choose an instance type from a predefined set ofinstance types. As another example, a client may specify the desiredresources of an instance type, and the instance type selectionfunctionality 120 may select an instance type based on such aspecification.

In one embodiment, the provider network 100 may offer virtual GPUs151A-151Z with varying graphics processing capabilities. In oneembodiment, each of the virtual GPUs 151A-151Z may correspond to one ofseveral virtual GPU classes. A virtual GPU class may be characterized byits computational resources for graphics processing, memory resourcesfor graphics processing, and/or other suitable descriptivecharacteristics. In one embodiment, the virtual GPU classes mayrepresent subdivisions of graphics processing capabilities of a physicalGPU, such as a full GPU, a half GPU, a quarter GPU, and so on. Using theinstance type selection functionality 120, a virtual GPU class may beselected for a client, e.g., based (at least in part) on input from theclient. For example, a client may choose a virtual GPU class from apredefined set of virtual GPU classes. As another example, a client mayspecify the desired resources of a virtual GPU class, and the instancetype selection functionality 120 may select a virtual GPU class based onsuch a specification.

Therefore, using the instance type selection functionality 120, clients(e.g., using client devices 180A-180N) may specify requirements forvirtual compute instances and virtual GPUs. The instance provisioningfunctionality 130 may provision virtual compute instances with attachedvirtual GPUs based on the specified requirements (including anyspecified instance types and virtual GPU classes). As used herein,provisioning a virtual compute instance generally includes reservingresources (e.g., computational and memory resources) of an underlyingphysical compute instance for the client (e.g., from a pool of availablephysical compute instances and other resources), installing or launchingrequired software (e.g., an operating system), and making the virtualcompute instance available to the client for performing tasks specifiedby the client. For a particular client, a virtual compute instance maybe provisioned of the instance type selected by or for the client, andthe virtual compute instance may be provisioned with an attached virtualGPU of the GPU class selected by or for the client. In one embodiment, avirtual GPU of substantially any virtual GPU class may be attached to avirtual compute instance of substantially any instance type.

The provider network 100 may be set up by an entity such as a company ora public sector organization to provide one or more services (such asvarious types of cloud-based computing or storage) accessible via theInternet and/or other networks to client devices 180A-180N. Providernetwork 100 may include numerous data centers hosting various resourcepools, such as collections of physical and/or virtualized computerservers, storage devices, networking equipment and the like (e.g.,implemented using computing system 3000 described below with regard toFIG. 11), needed to implement and distribute the infrastructure andservices offered by the provider network 100. In some embodiments,provider network 100 may provide computing resources, such as computevirtualization service 140 and GPU virtualization service 150; storageservices, such as a block-based storage service, key-value based datastores, or various types of database systems; and/or any other type ofnetwork-based services. Client devices 180A-180N may access thesevarious services offered by provider network 100 via network(s) 190.Likewise, network-based services may themselves communicate and/or makeuse of one another to provide different services. For example, computingresources offered to client devices 180A-180N in units called“instances,” such as virtual or physical compute instances or storageinstances, may make use of particular data volumes, providing virtualblock storage for the compute instances. The provider network 100 mayimplement or provide a multi-tenant environment such that multipleclients (e.g., using client devices 180A-180N) may access or use aparticular resource in a substantially simultaneous manner.

As noted above, compute virtualization service 140 may offer variousvirtual compute instances 141A-141Z to client devices 180A-180N. Avirtual compute instance may, for example, comprise one or more serverswith a specified computational capacity (which may be specified byindicating the type and number of CPUs, the main memory size, and so on)and a specified software stack (e.g., a particular version of anoperating system, which may in turn run on top of a hypervisor). Anumber of different types of computing devices may be used singly or incombination to implement the compute instances of the computevirtualization service 140 in different embodiments, including generalpurpose or special purpose computer servers, storage devices, networkdevices and the like. In some embodiments, client devices 180A-180N orother any other user may be configured (and/or authorized) to directnetwork traffic to a virtual compute instance. In various embodiments,virtual compute instances 141A-141Z may attach or map to one or moredata volumes provided by a storage service in order to obtain persistentstorage for performing various operations. Using the techniquesdescribed herein, virtual GPUs 151A-151Z may be attached to virtualcompute instances 141A-141Z to provide graphics processing for thevirtual compute instances.

Virtual compute instances 141A-141Z may operate or implement a varietyof different platforms, such as application server instances, Java™virtual machines (JVMs) or other virtual machines, general purpose orspecial-purpose operating systems, platforms that support variousinterpreted or compiled programming languages such as Ruby, Perl,Python, C, C++ and the like, or high-performance computing platforms)suitable for performing client applications, without for examplerequiring the client devices 180A-180N to access an instance. In someembodiments, virtual compute instances 141A-141Z may have differentinstance types or configurations based on expected uptime ratios. Theuptime ratio of a particular virtual compute instance may be defined asthe ratio of the amount of time the instance is activated to the totalamount of time for which the instance is reserved. Uptime ratios mayalso be referred to as utilizations in some implementations. If a clientexpects to use a compute instance for a relatively small fraction of thetime for which the instance is reserved (e.g., 30%-35% of a year-longreservation), the client may decide to reserve the instance as a LowUptime Ratio instance, and the client may pay a discounted hourly usagefee in accordance with the associated pricing policy. If the clientexpects to have a steady-state workload that requires an instance to beup most of the time, then the client may reserve a High Uptime Ratioinstance and potentially pay an even lower hourly usage fee, although insome embodiments the hourly fee may be charged for the entire durationof the reservation, regardless of the actual number of hours of use, inaccordance with pricing policy. An option for Medium Uptime Ratioinstances, with a corresponding pricing policy, may be supported in someembodiments as well, where the upfront costs and the per-hour costs fallbetween the corresponding High Uptime Ratio and Low Uptime Ratio costs.

Virtual compute instance configurations may also include virtual computeinstances with a general or specific purpose, such as computationalworkloads for compute intensive applications (e.g., high-traffic webapplications, ad serving, batch processing, video encoding, distributedanalytics, high-energy physics, genome analysis, and computational fluiddynamics), graphics intensive workloads (e.g., game streaming, 3Dapplication streaming, server-side graphics workloads, rendering,financial modeling, and engineering design), memory intensive workloads(e.g., high performance databases, distributed memory caches, in-memoryanalytics, genome assembly and analysis), and storage optimizedworkloads (e.g., data warehousing and cluster file systems). In someembodiments, particular instance types for virtual compute instances maybe associated with default classes for virtual GPUs. For example, someinstance types may be configured without a virtual GPU as a defaultconfiguration, while other instance types designated for graphicsintensive workloads may be designated with particular virtual GPUclasses as a default configuration. Configurations of virtual computeinstances may also include their location in a particular data center oravailability zone, geographic location, and (in the case of reservedcompute instances) reservation term length.

The client devices 180A-180N may represent or correspond to variousclients or users of the provider network 100, such as customers who seekto use services offered by the provider network. The clients, users, orcustomers may represent persons, businesses, other organizations, and/orother entities. The client devices 180A-180N may be distributed over anysuitable locations or regions. Each of the client devices 180A-180N maybe implemented using one or more computing devices, any of which may beimplemented by the example computing device 3000 illustrated in FIG. 11.

The client devices 180A-180N may encompass any type of clientconfigurable to submit requests to provider network 100. For example, agiven client device may include a suitable version of a web browser, orit may include a plug-in module or other type of code module configuredto execute as an extension to or within an execution environmentprovided by a web browser. Alternatively, a client device may encompassan application such as a database application (or user interfacethereof), a media application, an office application, or any otherapplication that may make use of virtual compute instances, storagevolumes, or other network-based services in provider network 100 toperform various operations. In some embodiments, such an application mayinclude sufficient protocol support (e.g., for a suitable version ofHypertext Transfer Protocol [HTTP]) for generating and processingnetwork-based service requests without necessarily implementing fullbrowser support for all types of network-based data. In someembodiments, client devices 180A-180N may be configured to generatenetwork-based service requests according to a Representational StateTransfer (REST)-style network-based services architecture, a document-or message-based network-based services architecture, or anothersuitable network-based services architecture. In some embodiments,client devices 180A-180N (e.g., a computational client) may beconfigured to provide access to a virtual compute instance in a mannerthat is transparent to applications implement on the client deviceutilizing computational resources provided by the virtual computeinstance. In at least some embodiments, client devices 180A-180N mayprovision, mount, and configure storage volumes implemented at storageservices for file systems implemented at the client devices.

Client devices 180A-180N may convey network-based service requests toprovider network 100 via external network(s) 190. In variousembodiments, external network(s) 190 may encompass any suitablecombination of networking hardware and protocols necessary to establishnetwork-based communications between client devices 180A-180N andprovider network 100. For example, the network(s) 190 may generallyencompass the various telecommunications networks and service providersthat collectively implement the Internet. The network(s) 190 may alsoinclude private networks such as local area networks (LANs) or wide areanetworks (WANs) as well as public or private wireless networks. Forexample, both a given client device and the provider network 100 may berespectively provisioned within enterprises having their own internalnetworks. In such an embodiment, the network(s) 190 may include thehardware (e.g., modems, routers, switches, load balancers, proxyservers, etc.) and software (e.g., protocol stacks, accounting software,firewall/security software, etc.) necessary to establish a networkinglink between the given client device and the Internet as well as betweenthe Internet and the provider network 100. It is noted that in someembodiments, client devices 180A-180N may communicate with providernetwork 100 using a private network rather than the public Internet.

The provider network 100 may include a plurality of computing devices,any of which may be implemented by the example computing device 3000illustrated in FIG. 11. In various embodiments, portions of thedescribed functionality of the provider network 100 may be provided bythe same computing device or by any suitable number of differentcomputing devices. If any of the components of the provider network 100are implemented using different computing devices, then the componentsand their respective computing devices may be communicatively coupled,e.g., via a network. Each of the illustrated components (such as theelastic graphics service 110 and its constituent functionalities 120 and130) may represent any combination of software and hardware usable toperform their respective functions.

It is contemplated that the provider network 100 may include additionalcomponents not shown, fewer components than shown, or differentcombinations, configurations, or quantities of the components shown. Forexample, although physical compute instances 142A through 142N are shownfor purposes of example and illustration, it is contemplated thatdifferent quantities and configurations of physical compute instancesmay be used. Similarly, although physical GPUs 152A through 152N areshown for purposes of example and illustration, it is contemplated thatdifferent quantities and configurations of physical GPUs may be used.Additionally, although three client devices 180A, 180B, and 180N areshown for purposes of example and illustration, it is contemplated thatdifferent quantities and configurations of client devices may be used.Aspects of the functionality described herein for providing virtualizedgraphics processing may be performed, at least in part, by componentsoutside of the provider network 100.

FIG. 2A illustrates further aspects of the example system environmentfor virtualizing graphics processing in a provider network, includingselection of an instance type and virtual GPU class for a virtualcompute instance with an attached virtual GPU, according to oneembodiment. As discussed above, the provider network 100 may offer tothe client device 180A a plurality of instance types 121 for virtualcompute instances. As shown for purposes of illustration and example,virtual compute instances of type “B” 141B through type “N” 141N may beoffered. However, it is contemplated that any suitable number andconfiguration of virtual compute instance types may be offered toclients by the provider network 100. An instance type may becharacterized by its computational resources (e.g., number, type, andconfiguration of central processing units [CPUs] or CPU cores), memoryresources (e.g., capacity, type, and configuration of local memory),storage resources (e.g., capacity, type, and configuration of locallyaccessible storage), network resources (e.g., characteristics of itsnetwork interface and/or network capabilities), and/or other suitabledescriptive characteristics. Using the instance type selectionfunctionality 120, the client device 180A may provide an indication,specification, or other selection 201 of a particular instance type. Forexample, a client may choose or the instance type “B” from a predefinedset of instance types using input 201. As another example, a client mayspecify the desired resources of an instance type using input 201, andthe instance type selection functionality 120 may select the instancetype “B” based on such a specification. Accordingly, the virtual computeinstance type may be selected by the client or on behalf of the client,e.g., using the instance type selection functionality 120.

As discussed above, the provider network 100 may offer to the clientdevice 180A a plurality of virtual GPU classes 122 for virtual GPUs. Asshown for purposes of illustration and example, virtual GPUs of class“B” 151B through class “N” 151N may be offered. However, it iscontemplated that any suitable number and configuration of virtual GPUclasses may be offered to clients by the provider network 100. A virtualGPU class may be characterized by its computational resources forgraphics processing, memory resources for graphics processing, and/orother suitable descriptive characteristics. In one embodiment, thevirtual GPU classes may represent subdivisions of graphics processingcapabilities of a physical GPU, such as a full GPU, a half GPU, aquarter GPU, and so on. Using the instance type selection functionality120, the client device 180A may provide an indication, specification, orother selection 202 of a particular virtual GPU class. For example, aclient may choose the virtual GPU class “B” from a predefined set ofvirtual GPU classes using input 202. As another example, a client mayspecify the desired resources of a virtual GPU class using input 202,and the instance type selection functionality 120 may select the virtualGPU class “B” based on such a specification. Accordingly, the virtualGPU class may be selected by the client or on behalf of the client,e.g., using the instance type selection functionality 120.

FIG. 2B illustrates further aspects of the example system environmentfor virtualizing graphics processing in a provider network, includingprovisioning of a virtual compute instance with an attached virtual GPU,according to one embodiment. The instance provisioning functionality 130may provision a virtual compute instance 141B with an attached virtualGPU 151B based on the specified instance type “B” and the specifiedvirtual GPU class “B”. The provisioned virtual compute instance 141B maybe implemented by the compute virtualization functionality 140 usingsuitable physical resources such as a physical compute instance 142B,and the provisioned virtual GPU 151B may be implemented by the GPUvirtualization functionality 150 using suitable physical resources suchas a physical GPU 152B. As used herein, provisioning a virtual computeinstance generally includes reserving resources (e.g., computational andmemory resources) of an underlying physical compute instance for theclient (e.g., from a pool of available physical compute instances andother resources), installing or launching required software (e.g., anoperating system), and making the virtual compute instance available tothe client for performing tasks specified by the client. In oneembodiment, a virtual GPU of substantially any virtual GPU class may beattached to a virtual compute instance of substantially any instancetype. To implement the virtual compute instance 141B with the attachedvirtual GPU 151B, a physical compute instance 142B may communicate witha physical GPU 152B, e.g., over a network. The physical GPU 152B may belocated in a different computing device than the physical computeinstance 142B. Even though they may be implemented using separatehardware, the virtual GPU 151B may be said to be attached to the virtualcompute instance 141B, or the virtual compute instance may be said toinclude the virtual GPU. The virtual GPU 151B may be installed on adevice that may reside in various locations relative to the physical GPU152B, e.g., on the same rack, the same switch, the same room, and/orother suitable locations on the same network. A vendor of the physicalGPU 152B may be hidden from the client device 180A.

FIG. 3 illustrates the use of a virtual compute instance with a virtualGPU to generate virtual GPU output for display on a client device,according to one embodiment. After the virtual compute instance 141B isprovisioned with the attached virtual GPU 151B, the client device 180Amay use the provisioned instance and virtual GPU to perform any suitabletasks, e.g., based on input from the client device. The virtual computeinstance 141B may execute a particular application 320. The application320 may be selected or provided by the client. The virtual computeinstance 141B may also be configured with a particular operating system322 that provides support for the application 321. Additionally, thevirtual compute instance 141B may be configured with a particulargraphics driver 321. The graphics driver 321 may interact with thevirtual GPU 151B to provide graphics processing for the application 320,including accelerated two-dimensional graphics processing and/oraccelerated three-dimensional graphics processing. In one embodiment,the graphics driver 321 may implement a graphics application programminginterface (API) such as Direct3D or OpenGL. The graphics driver 321 mayrepresent components running in user mode and/or kernel mode. Additionalcomponents (not shown), such as a graphics runtime, may also be used toprovide accelerated graphics processing on the virtual compute instance141B.

The client device 180A may communicate with the virtual compute instance141B through a proxy 310. Various other communications may be sentthrough the proxy 310, including for example virtual GPU output 302 fromthe virtual GPU 151B to the client device 180A. Use of the proxy 310 mayhide the address of the virtual compute instance and any associatedresources (including a computing device that implements the virtual GPU151B) from the client device 180A. The proxy 310 and virtual computeinstance 141B may communicate using a suitable remoting protocol. Invarious embodiments, the proxy 310 may or may not be part of theprovider network 100. The client device 180A may provide applicationinput 301 to the application 320 running on the virtual compute instance141B. For example, the application input 301 may include data to beoperated upon by the application 320 and/or instructions to control theexecution of the application.

Using the graphics processing provided by the virtual GPU 151B,execution of the application may generate virtual GPU output 302. Thevirtual GPU output 302 may be provided to the client device 180A, e.g.,from the virtual GPU 151B or virtual compute instance 141B. In oneembodiment, the virtual GPU output 302 may be sent from the virtual GPU151B (e.g., from a computing device that includes the virtual GPU) tothe client device 180A while bypassing the rest of the virtual computeinstance 141B (e.g., the underlying physical compute instance 142B). Thevirtual GPU output 302 may also be sent to the client device 180Athrough the proxy 310. The proxy 310 and virtual GPU 151B maycommunicate using a suitable remoting protocol. In one embodiment, thevirtual GPU output 302 may be returned to the virtual compute instance141B, and the virtual compute instance may send the virtual GPU outputto the client device 180A. In one embodiment, the client device 180A mayforward the virtual GPU output 302 to another component.

In one embodiment, a display device 181 associated with the clientdevice 180A may present a display 330 of the virtual GPU output 302. Inone embodiment, the virtual GPU output 302 may include pixel data, imagedata, video data, or other graphical data. In one embodiment, thevirtual GPU output 302 may drive a full-screen display on the displaydevice 181. Portions of the virtual GPU output 302 may be streamed tothe client device 180A over time. In one embodiment, the virtual GPUoutput 302 may be composited with one or more other sources of graphicaldata to produce the display 330. In one embodiment, the virtual GPU 151Bmay be used for general-purpose computing (e.g., GPGPU computing), andthe virtual GPU output 302 may not include pixel data or other graphicaldata. In various embodiments, the client device 180A may process ortransform all or part of the virtual GPU output 302 before displayingthe output. For example, a CPU, GPU, or co-processor on the clientdevice 180A may transform portions of the virtual GPU output 302 anddisplay the results on the display device 181.

In various embodiments, any suitable technique(s) may be used to offloadgraphics processing from a virtual compute instance to a physical GPU.In one embodiment, an API shim may intercept calls to a graphics API andmarshal the calls over a network to an external computing device thatincludes a physical GPU. In one embodiment, a driver shim may surface aproprietary driver to the virtual compute instance, intercept calls, andmarshal the calls over a network to an external computing device thatincludes a physical GPU. In one embodiment, a hardware shim may surfacea hardware interface to the virtual compute instance and marshalattempts by the instance to interact with the physical GPU.

FIG. 4 illustrates an example hardware architecture for implementingvirtualized graphics processing, according to one embodiment. In oneembodiment, the virtual compute instance 141B may be implemented using aphysical compute instance 142B, and the virtual GPU 151B attached tothat instance 141B may be implemented using a separate and distinctcomputing device termed a graphics server 420. The virtual computeinstance 141B may use a virtual interface 400 to interact with aninterface device 410. The virtual interface 400 may enable the virtualcompute instance 141B to send and receive network data. The interfacedevice 410 may include a network interface and a custom hardwareinterface. Via the custom hardware interface, the interface device 410may run program code to emulate a GPU interface and appear to thevirtual compute instance 141B to implement or include the virtual GPU151B. In one embodiment, the interface device 410 may present a graphicsAPI to the virtual compute instance 141B and receive API calls forgraphics processing (e.g., accelerated 3D graphics processing). Via thenetwork interface, the interface device 410 may communicate with thegraphics server 420 (and thus with the physical GPU 152B) over anetwork. The interface device 410 may be implemented in any suitablemanner, e.g., as an expansion card (such as a PCI Express card) orattached peripheral device for the physical compute instance 142B. Theinterface device 410 may use single root I/O virtualization to exposehardware virtual functions to the virtual compute instance 141B. In oneembodiment, the physical compute instance 142B may implement a pluralityof virtual compute instances, each with its own virtual interface, andthe virtual compute instances may use the interface device 410 tointeract with the corresponding virtual GPUs on one or more graphicsservers. The physical compute instance 142B may communicate with theproxy 310 using a suitable remoting protocol, e.g., to send data to andreceive data from the client device 180A.

Graphics offload performed by the interface device 410 (e.g., byexecuting custom program code on the interface device) may translategraphics API commands into network traffic (encapsulating the graphicsAPI commands) that is transmitted to the graphics server 420, and thegraphics server 420 may execute the commands on behalf of the interfacedevice. The graphics server 420 may include a network adapter 440 thatcommunicates with the interface device 410 (e.g., with the networkinterface of the interface device) over a network. In one embodiment,the interface device 410 may receive calls to a graphics API (using thecustom hardware interface) and generate graphics offload traffic to besent to the network adapter 440 (using the network interface). Thegraphics server 410 may implement a graphics virtual machine 430. Anysuitable technologies for virtualization may be used to implement thegraphics virtual machine 430. In one embodiment, the graphics virtualmachine 430 may represent a generic virtual machine that is GPU-capableand is dedicated to providing accelerated graphics processing using oneor more virtual GPUs. The graphics virtual machine 430 may be coupled tothe network adapter 440 using a virtual interface 401. The virtualinterface 401 may enable the graphics virtual machine 430 to send andreceive network data. The graphics virtual machine 430 may implement thevirtual GPU 151B using the graphics processing capabilities of thephysical GPU 152B. In one embodiment, the physical GPU 152B can beaccessed directly by the graphics virtual machine 430, and the physicalGPU 152B can use direct memory access to write to and read from memorymanaged by the graphics virtual machine. In one embodiment, the graphicsserver 420 may implement a plurality of virtual GPUs (such as virtualGPU 151B) using one or more physical GPUs (such as physical GPU 152B),and the virtual GPUs may interact with the corresponding virtual computeinstances on one or more physical compute instances over a network. Thegraphics server 420 may communicate with the proxy 310 using a suitableremoting protocol, e.g., to send data to and receive data from theclient device 180A. For example, the graphics server 420 may generatevirtual GPU output based on the commands sent from the interface device410. The virtual GPU output may be provided to the client device 180Athrough the proxy 310, e.g., from the physical compute instance 142B orgraphics server 420.

FIG. 5 is a flowchart illustrating a method for virtualizing graphicsprocessing in a provider network, according to one embodiment. As shownin 505, a virtual compute instance may be selected. The virtual computeinstance may be selected based (at least in part) on computational andmemory resources provided by the virtual compute instance. For example,the virtual compute instance may be selected based (at least in part) ona selection of an instance type by a user. As shown in 510, a virtualGPU may be selected. The virtual GPU may be selected based (at least inpart) on graphics processing capabilities provided by the virtual GPU.For example, the virtual GPU may be selected based (at least in part) ona selection of a virtual GPU class by a user. The virtual computeinstance and virtual GPU may also be selected based (at least in part)on availability of resources in a resource pool of a provider networkthat manages such resources. In one embodiment, an elastic graphicsservice may receive the specifications for and/or selections of thevirtual compute instance and virtual GPU.

As shown in 515, the selected virtual compute instance may beprovisioned with the selected virtual GPU attached. In one embodiment,the elastic graphics service may interact with one or more otherservices or functionalities of a provider network, such as a computevirtualization functionality and/or GPU virtualization functionality, toprovision the instance with the virtual GPU. The virtual computeinstance may be implemented using central processing unit (CPU)resources and memory resources of a physical compute instance. Thevirtual GPU may be implemented using a physical GPU. The physical GPUmay be attached to a different computing device than the computingdevice that provides the CPU resources for the virtual compute instance.The physical GPU may be accessible to the physical compute instance overa network. The virtual GPU may be said to be attached to the virtualcompute instance, or the virtual compute instance may be said to includethe virtual GPU. In one embodiment, the physical GPU may be sharedbetween the virtual GPU and one or more additional virtual GPUs, and theadditional virtual GPUs may be attached to additional virtual computeinstances. In one embodiment, the virtual GPU may be accessible to thevirtual compute instance via an interface device that includes a networkinterface and a custom hardware interface. Via the custom hardwareinterface, the interface device may emulate a GPU and appear to thevirtual compute instance to include the virtual GPU. Via the networkinterface, the interface device may communicate with the physical GPUover the network.

As shown in 520, an application may be executed on the virtual computeinstance using the virtual GPU. Execution of the application may includeexecution of instructions on the virtual compute instance (e.g., on theunderlying physical compute instance) and/or virtual GPU (e.g., on theunderlying physical GPU). Execution of the application using the virtualGPU may generate virtual GPU output, e.g., output produced by executinginstructions or otherwise performing tasks on the virtual GPU. As shownin 525, the virtual GPU output may be provided to a client device. Thevirtual GPU output may be provided to the client device from the virtualcompute instance or virtual GPU. In one embodiment, the virtual GPUoutput may be displayed on a display device associated with the clientdevice. The virtual GPU output may include pixel information or othergraphical data that is displayed on the display device. Execution of theapplication using the virtual GPU may include graphics processing (e.g.,acceleration of three-dimensional graphics processing) for theapplication using a graphics API.

Application-Specific Virtualized Graphics Processing

In some embodiments, virtualized graphics processing may be provided onan application-specific basis. Using the techniques discussed above forvirtualized graphics processing in a provider network, a virtual computeinstance may be provisioned. The virtual compute instance may beconfigured to execute a particular application. As will be discussed ingreater detail below, a virtual GPU may be attached to the virtualcompute instance specifically for use by the particular application. Theapplication-specific virtual GPU may be dedicated to the particularapplication, and other applications running on the virtual computeinstance may have no access to this particular virtual GPU. In oneembodiment, a plurality of applications on the virtual compute instancemay have their own dedicated virtual GPUs. The capabilities of thevirtual GPUs may vary based on characteristics of the associatedapplications. In one embodiment, one or more other applications on thevirtual compute instance may not have access to any virtual GPUs, e.g.,if the graphics requirements for the other applications are notsufficient to justify the cost of a virtual GPU. As used herein, theterm “application” generally includes a set of program instructions, asoftware package, or a set of interconnected software resources designedto perform a set of coordinated functions when executed on a computeinstance, often on top of an operating system resident on the computeinstance.

FIG. 6A illustrates an example system environment forapplication-specific virtualized graphics processing, includingselection of a virtual GPU based (at least in part) on requirements foran application, according to one embodiment. An application on a virtualcompute instance may be associated with a set of requirements 602. Therequirements 602 may include requirements for graphics processing and/orcomputational requirements and may also be referred to herein asgraphics requirements. For example, the graphics requirements 602 mayspecify a recommended graphics processing unit (GPU) class, arecommended size for video memory, or other GPU features and/orconfigurations that are recommended to run the application. In oneembodiment, the graphics requirements 602 may be determined using anapplication manifest 605 that specifies required or recommendedcharacteristics of a platform (e.g., computational and memoryrequirements) or environment for executing the application, includingcharacteristics of a physical compute instance or virtual computeinstance. The application manifest 605 may be determined and provided bya developer of the corresponding application who seeks a degree ofcontrol over the type of platform or environment on which theapplication is executed. The application may be implemented using anapplication virtualization container, and the manifest may be providedwith the container for the application.

In one embodiment, programmatic analysis 606 of the application maydetermine the graphics requirements 602 for the application. Theapplication analysis 606 may include runtime analysis of a graphicsworkload demanded by the application and/or analysis of an executionhistory (including graphics workload) of the application, e.g., usingsimilar virtual hardware as the current instance. The graphics workloadfor the application, either current or historical, may be based on anysuitable metrics relating to use of a virtual GPU or underlying physicalGPU, such as the number of primitives sent to the GPU, the number ofoperations requested of the GPU, the video memory used by the GPU,and/or the rate of output from the GPU over a period of time.

In one embodiment, the graphics requirements 602 may be provided to theelastic graphics service 110 by a client 180A. In one embodiment, theelastic graphics service 110 may determine the graphics requirements 602directly from the application manifest 605 and/or application analysis606. As shown in FIG. 6A, if the client 180A also seeks to provision avirtual compute instance, the client may provide an indication of therequested instance type 201 for the virtual compute instance along withthe graphics requirements 602 for the application-specific virtual GPU.However, the client may also provide the graphics requirements 602 forthe application-specific virtual GPU for a virtual compute instance thathas already been provisioned and potentially used to execute one or moreapplications.

As discussed above, the elastic graphics service 110 may offer, toclients, selection and provisioning of virtualized compute instanceswith attached virtualized GPUs, including application-specific virtualGPUs. The elastic graphics service 110 may include an instance typeselection functionality 120 and an instance provisioning functionality130. As discussed above, the provider network 100 may offer to theclient device 180A a plurality of instance types 121 for virtual computeinstances. As shown for purposes of illustration and example, virtualcompute instances of type “B” 141B through type “N” 141N may be offered.However, it is contemplated that any suitable number and configurationof virtual compute instance types may be offered to clients by theprovider network 100. An instance type may be characterized by itscomputational resources (e.g., number, type, and configuration ofcentral processing units [CPUs] or CPU cores), memory resources (e.g.,capacity, type, and configuration of local memory), storage resources(e.g., capacity, type, and configuration of locally accessible storage),network resources (e.g., characteristics of its network interface and/ornetwork capabilities), and/or other suitable descriptivecharacteristics. Using the instance type selection functionality 120,the client device 180A may provide an indication, specification, orother selection 201 of a particular instance type. For example, a clientmay choose or the instance type “B” from a predefined set of instancetypes using input 201. As another example, a client may specify thedesired resources of an instance type using input 201, and the instancetype selection functionality 120 may select the instance type “B” basedon such a specification. Accordingly, the virtual compute instance typemay be selected by the client or on behalf of the client, e.g., usingthe instance type selection functionality 120.

As discussed above, the provider network 100 may offer to the clientdevice 180A a plurality of virtual GPU classes 122 for virtual GPUs. Asshown for purposes of illustration and example, virtual GPUs of class“B” 151B through class “N” 151N may be offered. However, it iscontemplated that any suitable number and configuration of virtual GPUclasses may be offered to clients by the provider network 100. A virtualGPU class may be characterized by its computational resources forgraphics processing, memory resources for graphics processing, and/orother suitable descriptive characteristics. In one embodiment, thevirtual GPU classes may represent subdivisions of graphics processingcapabilities of a physical GPU, such as a full GPU, a half GPU, aquarter GPU, and so on. The client device 180A may provideapplication-specific graphics requirements 602 that the instance typeselection functionality 120 may use to select a particular virtual GPUclass. For example, the graphics requirements 602 may specify or mapdirectly to the virtual GPU class “B” from a predefined set of virtualGPU classes. As another example, the graphics requirements 602 mayspecify the desired resources of a virtual GPU class, and the instancetype selection functionality 120 may select the virtual GPU class “B”based on such requirements. If the graphics requirements specify aminimum set of resources for a virtual GPU to be used with anapplication, then a virtual GPU may be selected that meets or exceedsthose minimum set of resources. Accordingly, the virtual GPU class maybe selected by the client or on behalf of the client for use with aparticular application having particular requirements.

In some circumstances, the class of virtual GPU dictated by the graphicsrequirements for the application may not be available. The virtual GPUclass may not be available for technical reasons (e.g., during a busyperiod) or for business reasons (e.g., the selected GPU class is moreexpensive than permitted by an agreement between the user and theprovider network). In such circumstances, the elastic graphics servicemay either return an indication of failure or attempt to reconcile thedifference between the requested virtual GPU class and the availablevirtual GPUs. If a virtual GPU of a lesser class is available, theelastic graphics service may prompt the user for approval. In oneembodiment, the elastic graphics service may seek user approval to waituntil the requested virtual GPU class is available at an acceptablecost.

FIG. 6B illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingprovisioning of a virtual compute instance with an application-specificvirtual GPU attached, according to one embodiment. The instanceprovisioning functionality 130 may provision a virtual compute instance141B with an attached virtual GPU 151B based on the specified instancetype “B” and the virtual GPU class “B” selected based (at least in part)on the application-specific requirements 602. The provisioned virtualcompute instance 141B may be implemented by the compute virtualizationfunctionality 140 using suitable physical resources such as a physicalcompute instance 142B, and the provisioned virtual GPU 151B may beimplemented by the GPU virtualization functionality 150 using suitablephysical resources such as a physical GPU 152B. As used herein,provisioning a virtual compute instance generally includes reservingresources (e.g., computational and memory resources) of an underlyingphysical compute instance for the client (e.g., from a pool of availablephysical compute instances and other resources), installing or launchingrequired software (e.g., an operating system), and making the virtualcompute instance available to the client for performing tasks specifiedby the client. In one embodiment, a virtual GPU of substantially anyvirtual GPU class may be attached to a virtual compute instance ofsubstantially any instance type. To implement the virtual computeinstance 141B with the attached virtual GPU 151B, a physical computeinstance 142B may communicate with a physical GPU 152B, e.g., over anetwork. The physical GPU 152B may be located in a different computingdevice than the physical compute instance 142B. Even though they may beimplemented using separate hardware, the virtual GPU 151B may be said tobe attached to the virtual compute instance 141B, or the virtual computeinstance may be said to include the virtual GPU. The virtual GPU 151Bmay be installed on a device that may reside in various locationsrelative to the physical GPU 152B, e.g., on the same rack, the sameswitch, the same room, and/or other suitable locations on the samenetwork. A vendor of the physical GPU 152B may be hidden from the clientdevice 180A.

The virtual compute instance 141B may be configured to execute anapplication 620. Execution of the application 620 may include using thevirtual GPU 151B to generate output based on data supplied to thevirtual GPU by the application. The virtual GPU 151B may be attached tothe virtual compute instance 141B specifically for use by the particularapplication 620. The application-specific virtual GPU 151B may bededicated to the particular application 620, and other applicationsrunning on the virtual compute instance 141B may have no access to thisparticular virtual GPU 151B.

FIG. 7A illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingselection of a plurality of virtual GPUs based (at least in part) onrequirements for a plurality of applications, according to oneembodiment. In one embodiment, a plurality of applications on thevirtual compute instance may have their own dedicated virtual GPUs. Thecapabilities of the virtual GPUs may vary based on characteristics ofthe associated applications. As shown in the example of FIG. 7A, avirtual compute instance 141C may be provisioned by the computevirtualization facility 140 using resources of a multi-tenant providernetwork 100. In various embodiments, the virtual compute instance 141Cmay be provisioned and used (e.g., to execute one or more applications)before any virtual GPUs are attached or at the same time as the virtualGPUs are attached. The virtual compute instance 141C may be configuredto execute a plurality of applications, such as application 620A throughapplication 620N. The applications 620A-620N may be installed on thevirtual compute instance 141C from any source. The applications620A-620N may vary in their computational requirements and graphicsrequirements. The virtual compute instance 141C may be configured toexecute any two or more of the applications 620A-620N in a substantiallysimultaneous manner, e.g., using multiple processors or processor coresof the underlying physical compute instance and/or software-basedmultitasking techniques.

Each of the applications 620A-620N may be associated with a set ofgraphics requirements. As shown in FIG. 7A, the application 620A may beassociated with requirements 602A, and the application 620N may beassociated with requirements 602N. For example, the graphicsrequirements 602A-602N may specify a recommended graphics processingunit (GPU) class, a recommended size for video memory, or other GPUfeatures and/or configurations that are recommended to run thecorresponding application. In one embodiment, any of the graphicsrequirements 602A-602N may be determined using a correspondingapplication manifest 605A-605N that specifies required or recommendedcharacteristics of a platform or environment for executing thecorresponding application, including characteristics of a physicalcompute instance or virtual compute instance. The application manifest605A-605N may be determined and provided by a developer of thecorresponding application who seeks a degree of control over the type ofplatform or environment on which the application is executed. In oneembodiment, programmatic analysis 606A-606N of the correspondingapplication 620A-620N may determine the graphics requirements 605 forthe application. The application analysis 606A-606N may include runtimeanalysis of a graphics workload demanded by the application and/oranalysis of an execution history (including graphics workload) of theapplication, e.g., using similar virtual hardware as the currentinstance. The graphics workload for the application, either current orhistorical, may be based on any suitable metrics relating to use of avirtual GPU or underlying physical GPU, such as the number of primitivessent to the GPU, the number of operations requested of the GPU, thevideo memory used by the GPU, and/or the rate of output from the GPUover a period of time.

In one embodiment, the graphics requirements 602A-602N may be providedto the elastic graphics service 110 by a client for whom the instance141C was provisioned. In one embodiment, the elastic graphics service110 may determine the graphics requirements 602A-602N directly from theapplication manifest 605A-605N and/or application analysis 606A-606N. Asdiscussed above, the provider network 100 may offer to clients aplurality of virtual GPU classes 122 for virtual GPUs. As shown forpurposes of illustration and example, virtual GPUs of class “B” 151Bthrough class “N” 151N may be offered. However, it is contemplated thatany suitable number and configuration of virtual GPU classes may beoffered to clients by the provider network 100. A virtual GPU class maybe characterized by its computational resources for graphics processing,memory resources for graphics processing, and/or other suitabledescriptive characteristics. In one embodiment, the virtual GPU classesmay represent subdivisions of graphics processing capabilities of aphysical GPU, such as a full GPU, a half GPU, a quarter GPU, and so on.

The application-specific graphics requirements 602A-602N may be used bya virtual GPU selection functionality 720 to select, for any of theapplications 620A-620N, a particular virtual GPU class from among thevirtual GPU classes 122. For example, the graphics requirements 602A mayspecify or map directly to a virtual GPU class “C” from a predefined setof virtual GPU classes 122, and the graphics requirements 602N mayspecify or map directly to a virtual GPU class “N” from the set ofvirtual GPU classes. As another example, the graphics requirements 602Amay specify the desired resources of a virtual GPU class, and thevirtual GPU selection functionality 720 may select the virtual GPU class“C” based on such requirements. Similarly, the graphics requirements602N may specify the desired resources of a virtual GPU class, and thevirtual GPU selection functionality 720 may select the virtual GPU class“N” based on such requirements. If the graphics requirements specify aminimum set of resources for a virtual GPU to be used with anapplication, then a virtual GPU may be selected that meets or exceedsthose minimum set of resources. Accordingly, the virtual GPU classes maybe selected by the client or on behalf of the client for use withparticular applications having particular requirements. In oneembodiment, the elastic graphics service 110 may decline to select andattach a virtual GPU for a particular application based on itsrequirements, e.g., if the requirements are not sufficient to justifythe cost of a virtual GPU and/or the additional latency introduced byGPU virtualization.

FIG. 7B illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingprovisioning of a virtual compute instance with a plurality ofapplication-specific virtual GPUs attached, according to one embodiment.The elastic graphic service 110 may attach application-specific virtualGPUs to the instance 141C in accordance with the virtual GPU classesselected for the corresponding applications 620A-620N. As shown in FIG.7B, a virtual GPU 151C based on the selected virtual GPU class “C” maybe attached to the instance 141C for exclusive use by application 620A.Similarly, a virtual GPU 151N based on the selected virtual GPU class“N” may be attached to the instance 141C for exclusive use byapplication 620N. The provisioned virtual GPUs 151C-151N may beimplemented by the GPU virtualization functionality 150 using suitablephysical resources such as one or more physical GPUs 152A-152N. Toimplement the virtual compute instance 141C with the attached virtualGPUs 151C-151N, a physical compute instance may communicate with one ormore physical GPUs, e.g., over a network. The physical GPUs may belocated in a different computing device than the physical computeinstance. Even though they may be implemented using separate hardware,the virtual GPUs 151C-151N may be said to be attached to the virtualcompute instance 141C, or the virtual compute instance may be said toinclude the virtual GPUs. The virtual GPUs may be installed on one ormore devices that may reside in various locations relative to thephysical GPU, e.g., on the same rack, the same switch, the same room,and/or other suitable locations on the same network. The vendor(s) ofthe physical GPUs may be hidden from the client device that uses thevirtual compute instance 141C.

The virtual compute instance 141C may be configured to execute theapplications 620A-620N. Execution of the application 620A may includeusing the virtual GPU 151C to generate output based on data supplied tothe virtual GPU by the application. The virtual GPU 151C may be attachedto the virtual compute instance 141C specifically for use by theparticular application 620A. The application-specific virtual GPU 151Cmay be dedicated to the particular application 620A, and otherapplications running on the virtual compute instance 141C may have noaccess to this particular virtual GPU 151C. Similarly, execution of theapplication 620N may include using the virtual GPU 151N to generateoutput based on data supplied to the virtual GPU by the application. Thevirtual GPU 151N may be attached to the virtual compute instance 141Cspecifically for use by the particular application 620N. Theapplication-specific virtual GPU 151N may be dedicated to the particularapplication 620N, and other applications running on the virtual computeinstance 141C may have no access to this particular virtual GPU 151N. Inone embodiment, one or more other applications on the virtual computeinstance 141C may not have access to any virtual GPUs, e.g., if thegraphics requirements for the other applications are not sufficient tojustify the cost of a virtual GPU.

In one embodiment, the applications 620A-620N may interact with one ormore graphics drivers 321, as previously discussed with respect to FIG.3. The graphics driver(s) 321 may interact with the virtual GPUs151C-151N to provide graphics processing for the respective applications620A-620N. The graphics processing may include acceleratedtwo-dimensional graphics processing and/or accelerated three-dimensionalgraphics processing. In one embodiment, the graphics driver(s) 321 mayimplement a graphics application programming interface (API) such asDirect3D or OpenGL. The graphics driver(s) 321 may represent componentsrunning in user mode and/or kernel mode. As also as previously discussedwith respect to FIG. 3, a client device may communicate with the virtualcompute instance 141C through a proxy 310. Various other communicationsmay be sent through the proxy 310, including for example virtual GPUoutput from the virtual GPUs 151C-151N to the client device. Use of theproxy 310 may hide the address of the virtual compute instance 141C andany associated resources (including one or more computing devices thatimplement the virtual GPUs 151C-151N) from the client device.

In various embodiments, any suitable technique(s) may be used to offloadgraphics processing from the virtual compute instance 141C to one ormore physical GPUs used to implement the application-specific virtualGPUs 151C-151N. In one embodiment, an API shim may intercept calls to agraphics API and marshal the calls over a network to one or moreexternal computing devices that include physical GPUs. The API shim maybe application-specific, such that an instance of a dynamic link library(DLL) for graphics processing may be opened in the context of theprocess for each application that has a dedicated virtual GPU. The DLLmay connect to a particular one of the virtual GPUs 151C-151N andprovide exclusive access to that virtual GPU on behalf of thecorresponding application. The applications may be implemented usingapplication virtualization containers, and the API shim layer may bebuilt into the container for an application.

As discussed previously with respect to FIG. 4, the virtual computeinstance 141C may be implemented using a physical compute instance, andthe virtual GPUs 151C-151N attached to that instance 141C may beimplemented using one or more graphics servers 420. The virtual computeinstance 141C may use a virtual interface 400 to interact with aninterface device 410. The virtual interface 400 may enable the virtualcompute instance 141C to send and receive network data. The interfacedevice 410 may include a network interface and a custom hardwareinterface. Via the custom hardware interface, the interface device 410may run program code to emulate a GPU interface and appear to thevirtual compute instance 141C to implement or include theapplication-specific virtual GPUs 151C-151N. In one embodiment, theinterface device 410 may present a graphics API to the virtual computeinstance 141C and receive API calls for graphics processing (e.g.,accelerated 3D graphics processing). Via the network interface, theinterface device 410 may communicate with the graphics server 420 (andthus with the physical GPU 152B) over a network. The interface device410 may be implemented in any suitable manner, e.g., as an expansioncard (such as a PCI Express card) or attached peripheral device for thephysical compute instance 142B. The interface device 410 may use singleroot I/O virtualization to expose hardware virtual functions to thevirtual compute instance 141C.

FIG. 7C illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingprovisioning of a virtual compute instance with a plurality ofapplication-specific virtual GPUs dedicated to a single application,according to one embodiment. In one embodiment, the elastic graphicsservice 110 may decline select and attach multiple virtual GPUs for aparticular application based on its requirements. As shown in theexample of FIG. 7C, two or more virtual GPUs 151C-151M may be selectedbased on the requirements 602A for application 620A, and all the virtualGPUs may be attached to the instance 141C for exclusive use by theapplication 620A. The two or more virtual GPUs 151C-151M selected forthe application 620A may collectively meet or exceed the requirements602A. In one embodiment, the two or more virtual GPUs 151C-151M may beof the same class, e.g., class “C,” to facilitate concurrent use by theapplication 620A. Two or more GPUs may be dedicated to a specificapplication for any suitable reason(s). For example, two or more virtualGPUs may be dedicated to a particular application if no single virtualGPU can meet the requirements of the application. As another example,two or more virtual GPUs may be dedicated to a particular application ifno single virtual GPU that meets the requirements of the application iscurrently available in the multi-tenant provider network. As yet anotherexample, two or more virtual GPUs may be dedicated to a particularapplication if no single virtual GPU that meets the requirements of theapplication is currently available within a budget specified by aclient.

Any suitable techniques may be used to permit a single application touse multiple virtual GPUs. In one embodiment, input data from theapplication 620A may be broadcast to all of the application-specificvirtual GPUs 151C-151M, and the virtual GPUs may operate in a concurrentmanner on different portions of the input data. The broadcasting may beperformed using an API shim. The workload may then be divided among thevirtual GPUs 151C-151M, e.g., based on the relative capabilities of thevirtual GPUs. For example, each of the virtual GPUs 151C-151M may bededicated to a particular region of the display, and the output from thevirtual GPUs may be combined to generate each frame. As another example,each of the virtual GPUs 151C-151M may be dedicated to a particularframe in a sequence (e.g., every other frame for two virtual GPUs), andthe output from the virtual GPUs may be combined to generate a sequenceof frames.

In one embodiment, the elastic graphics service 110 may decline toselect and attach a virtual GPU for a particular application. As shownin the example of FIG. 7C, an application-specific virtual GPU may notbe selected or attached for the application 620N based (at least inpart) on the requirements 602N. A virtual GPU may not be dedicated to aspecific application for any suitable reason(s). For example, a virtualGPU may not be dedicated to a particular application if the requirementsfor the application do not justify the cost (to the client) of a virtualGPU and/or the additional network latency introduced by GPUvirtualization. As another example, a virtual GPU may not be dedicatedto a particular application if no virtual GPU that meets therequirements of the application is currently available in themulti-tenant provider network. As yet another example, a virtual GPU maynot be dedicated to a particular application if no virtual GPU iscurrently available within a budget specified by a client. In oneembodiment, the application 620N may still have access to graphicsprocessing provided by a local GPU (as discussed below with respect toFIG. 9A through FIG. 11) and/or a virtual GPU that is attached to theinstance 141C but is not application-specific.

FIG. 8 is a flowchart illustrating a method for providingapplication-specific virtualized graphics processing, according to oneembodiment. As shown in 805, the graphics requirements for anapplication may be determined. A virtual compute instance may beconfigured to execute the application. In one embodiment, an elasticgraphics service may receive the graphics requirements for theapplication, e.g., from a client, or may otherwise determine therequirements without client input. The graphics requirements may specifya recommended graphics processing unit (GPU) class, a recommended sizefor video memory, or other GPU features and/or configurations that arerecommended to run the application. In one embodiment, the graphicsrequirements may be determined using an application manifest thatspecifies required or recommended characteristics of a platform orenvironment for executing the application, including characteristics ofa physical compute instance or virtual compute instance. The applicationmanifest may be determined and provided by a developer of thecorresponding application who seeks a degree of control over the type ofplatform or environment on which the application is executed. In oneembodiment, programmatic analysis of the application may determine thegraphics requirements for the application. The analysis may includeruntime analysis of a graphics workload demanded by the applicationand/or analysis of an execution history (including graphics workload) ofthe application, e.g., using similar virtual hardware as the currentinstance. The graphics workload for the application, either current orhistorical, may be based on any suitable metrics relating to use of avirtual GPU or underlying physical GPU, such as the number of primitivessent to the GPU, the number of operations requested of the GPU, thevideo memory used by the GPU, and/or the rate of output from the GPUover a period of time. The operation shown in 805 may be performedmultiple times for multiple applications, such that the differentgraphics requirements for multiple applications may be determined for aparticular instance.

As shown in 810, a virtual GPU may be selected. The virtual GPU may beselected based (at least in part) on the graphics processingcapabilities it provides and on the graphics requirements for theapplication. For example, if the graphics requirements specify a minimumset of resources for a virtual GPU to be used with an application, thena virtual GPU may be selected that meets or exceeds those minimum set ofresources. The virtual GPU may be selected from a set of virtual GPUclasses characterized by their differing computational resources forgraphics processing, memory resources for graphics processing, and/orother suitable descriptive characteristics. In one embodiment, thevirtual GPU classes may represent subdivisions of graphics processingcapabilities of a physical GPU, such as a full GPU, a half GPU, aquarter GPU, and so on. The application-specific graphics requirementsmay be used to select a particular virtual GPU class. For example, thegraphics requirements may specify or map directly to a particularvirtual GPU class. As another example, the graphics requirements mayspecify the desired resources of a virtual GPU class, and a particularvirtual GPU class may be selected based on such requirements. Thevirtual GPU may also be selected based (at least in part) onavailability of resources in a resource pool of a provider network thatmanages such resources. The operation shown in 810 may be performedmultiple times for multiple applications, such that multipleapplication-specific virtual GPUs may be selected based (at least inpart) on the different graphics requirements for multiple applications.

As shown in 815, the selected virtual GPU may be attached to the virtualcompute instance. In one embodiment, the elastic graphics service mayinteract with one or more other services or functionalities of aprovider network, such as a compute virtualization functionality and/orGPU virtualization functionality, to attach the virtual GPU to theinstance. The virtual compute instance may be implemented using centralprocessing unit (CPU) resources and memory resources of a physicalcompute instance. The virtual GPU may be implemented using a physicalGPU. The physical GPU may be attached to a different computing devicethan the computing device that provides the CPU resources for thevirtual compute instance. The physical GPU may be accessible to thephysical compute instance over a network. The virtual GPU may be said tobe attached to the virtual compute instance, or the virtual computeinstance may be said to include the virtual GPU. In one embodiment, thephysical GPU may be shared between the virtual GPU and one or moreadditional virtual GPUs, and the additional virtual GPUs may be attachedto additional virtual compute instances. In one embodiment, the virtualGPU may be accessible to the virtual compute instance via an interfacedevice that includes a network interface and a custom hardwareinterface. Via the custom hardware interface, the interface device mayemulate a GPU and appear to the virtual compute instance to include thevirtual GPU. Via the network interface, the interface device maycommunicate with the physical GPU over the network. The operation shownin 815 may be performed multiple times for multiple applications, suchthat multiple application-specific virtual GPUs may be attached to thesame instance for multiple applications. The operations shown in 810 and815 may be performed in response to user input or in response to anautomatic determination, e.g., by an elastic graphics service.

As shown in 820, the application may be executed on the virtual computeinstance using the application-specific virtual GPU. Execution of theapplication may include execution of instructions on the virtual computeinstance (e.g., on the underlying physical compute instance) and/orvirtual GPU (e.g., on the underlying physical GPU). Execution of theapplication using the application-specific virtual GPU may generatevirtual GPU output, e.g., output produced by executing instructions orotherwise performing tasks on the virtual GPU. Additional applicationson the virtual compute instance may use different application-specificvirtual GPUs, and the application-specific virtual GPUs may vary ingraphics processing capabilities based on the varying requirements ofthe applications. The operation shown in 820 may be performed multipletimes for multiple applications, such that multiple application-specificvirtual GPUs may be used on the same instance by multiple applications.

As shown in 825, the virtual GPU output may be provided to a clientdevice. The virtual GPU output may be provided to the client device fromthe virtual compute instance or virtual GPU. In one embodiment, thevirtual GPU output may be displayed on a display device associated withthe client device. The virtual GPU output may include pixel informationor other graphical data that is displayed on the display device.Execution of the application using the virtual GPU may include graphicsprocessing (e.g., acceleration of three-dimensional graphics processing)for the application using a graphics API.

Local-to-Remote Migration for Virtualized Graphics Processing

In some embodiments, the graphics processing for one GPU associated witha virtual compute instance maybe migrated to a virtual GPU. In oneembodiment, the graphics processing provided by a local GPU may bemigrated to a virtual GPU. In one embodiment, the graphics processingprovided by a first virtual GPU may be migrated to a second virtual GPU.The local GPU may be implemented using attached hardware (e.g., in aphysical compute instance used to implement the virtual computeinstance) or using emulation. Because the local GPU may provide only alow level of graphics processing capability, a virtual GPU may beattached to the virtual compute instance to provide improved graphicsprocessing relative to the local GPU. In one embodiment, the migrationof graphics processing may be performed based (at least in part) ondetection of an increase in graphics workload. Live migration may beperformed while applications are being executed using the original GPUin a manner that does not require changing or relaunching theapplications. Migration of the virtual compute instance to a differentvirtual compute instance may also be performed, e.g., to reduce networklatency associated with virtualized graphics processing. Graphicsprocessing for a virtual compute instance may also be migrated from onevirtual GPU to another virtual GPU, e.g., from a less capable or smallervirtual GPU class to a more capable or larger virtual GPU class.

FIG. 9A illustrates an example system environment for local-to-remotemigration for virtualized graphics processing, including provisioning ofa virtual compute instance with a local GPU, according to oneembodiment. As discussed above, the elastic graphics service 110 mayoffer, to clients, selection and provisioning of virtualized computeinstances, potentially with attached virtualized GPUs. The elasticgraphics service 110 may include an instance type selectionfunctionality 120 and an instance provisioning functionality 130. Asdiscussed above, the provider network 100 may offer to the client device180A a plurality of instance types for virtual compute instances. Aninstance type may be characterized by its computational resources (e.g.,number, type, and configuration of central processing units [CPUs] orCPU cores), memory resources (e.g., capacity, type, and configuration oflocal memory), storage resources (e.g., capacity, type, andconfiguration of locally accessible storage), network resources (e.g.,characteristics of its network interface and/or network capabilities),and/or other suitable descriptive characteristics. Using the instancetype selection functionality 120, the client device 180A may provide anindication, specification, or other selection 901 of a particularinstance type. For example, a client may choose or the instance type “B”from a predefined set of instance types using input 901. As anotherexample, a client may specify the desired resources of an instance typeusing input 901, and the instance type selection functionality 120 mayselect the instance type “D” based on such a specification. Accordingly,the virtual compute instance type may be selected by the client or onbehalf of the client, e.g., using the instance type selectionfunctionality 120.

The instance provisioning functionality 130 may provision a virtualcompute instance 141D with a local GPU 941 based on the instance type“D.” The provisioned virtual compute instance 141D may be implemented bythe compute virtualization functionality 140 using suitable physicalresources such as a physical compute instance 142C. As used herein,provisioning a virtual compute instance generally includes reservingresources (e.g., computational and memory resources) of an underlyingphysical compute instance for the client (e.g., from a pool of availablephysical compute instances and other resources), installing or launchingrequired software (e.g., an operating system), and making the virtualcompute instance available to the client for performing tasks specifiedby the client.

At the time of its provisioning, the instance 141D may not have anattached virtual GPU. The provisioned instance 141D may be of aninstance type that includes the local GPU 941 in a defaultconfiguration. In one embodiment, the local GPU 941 may be implementedas a hardware component of the physical compute instance 142C used toimplement the virtual compute instance. For example, the local GPU 941may be implemented using the network-capable, customizable interfacedevice 410 shown in FIG. 4. Alternatively, the local GPU 941 may beimplemented using a dedicated physical GPU installed in or attached tothe physical compute instance 142C. In one embodiment, the local GPU 941may be implemented in software using emulation techniques. Typically,the local GPU 941 may provide a low level of graphics processingcapabilities in comparison to the virtual GPUs available through the GPUvirtualization functionality 150 of the provider network 100.

The virtual compute instance 141D may be used to execute one or moreapplications. At least one of the applications may use the local GPU941, e.g., for graphics processing. At some point, a change in graphicsworkload for the local GPU 941 may be detected during the use of thevirtual compute instance 141D. The change in graphics workload may bedetermined based on user input or automatically detected based onprogrammatic monitoring. For example, a user may indicate that thegraphics workload is expected to change for a currently runningapplication or due to an application that will be added to the instance;the user-supplied indication may include a general request for a morecapable virtual GPU or an identification of a specific class of virtualGPU. An automatically detected change in the graphics workload may bebased on any suitable metrics relating to use of a GPU, such as thenumber of primitives sent to the GPU, the number of operations requestedof the GPU, the video memory used by the GPU, and/or the rate of outputfrom the GPU over a period of time. The detected change may typicallyrepresent an increase in graphics workload, e.g., an increase beyond thegraphics capabilities of the local GPU 941. For example, if theapplication is using the local GPU 941 to produce full-screen 2D or 3Dgraphics, the graphics workload may increase such that the frames persecond (fps) decreases below a threshold of acceptable performance. Asanother example, the aggregate graphics workload generated by multipleapplications may push the local GPU 941 beyond a threshold of acceptableperformance as additional applications are executed simultaneously. Anysuitable techniques may be used for monitoring of the graphics workloadand detecting a change therein, and any suitable thresholds may be usedto assess when the graphics workload has increased sufficiently tojustify the attachment of a virtual GPU.

FIG. 9B illustrates further aspects of the example system environmentfor local-to-remote migration for virtualized graphics processing,including the selection and attachment of a virtual GPU to the virtualcompute instance, according to one embodiment. As discussed above, theprovider network 100 may offer a plurality of virtual GPU classes forvirtual GPUs. A virtual GPU class may be characterized by itscomputational resources for graphics processing, memory resources forgraphics processing, and/or other suitable descriptive characteristics.In one embodiment, the virtual GPU classes may represent subdivisions ofgraphics processing capabilities of a physical GPU, such as a full GPU,a half GPU, a quarter GPU, and so on. A particular virtual GPU 151B maybe selected for use with the virtual compute instance 141D, e.g., toreplace or supplement the use of the local GPU 941. The virtual GPU 151Bmay be selected from a set of virtual GPU classes having differentgraphics processing capabilities. The virtual GPU 151B may be selectedto match the current or anticipated graphics workload of the virtualcompute instance. Accordingly, the selected virtual GPU 151B may be of aclass, such as class “B,” that is capable of handling the graphicsworkload with an acceptable level of performance. In one embodiment, theelastic graphics service may store benchmarks or other metrics for eachclass of virtual GPU to indicate the graphics processing capabilitiesrelative to various levels of graphics workload. In one embodiment, thevirtual GPU 151B may be selected not based on a detected change in thegraphics workload but on a configuration change requested by or enabledby a user of the virtual compute instance. For example, if a newapplication is added to the virtual compute instance during its use, anapplication manifest for the new application may require greater GPUperformance than the instance currently provides (e.g., with the localGPU).

The selected virtual GPU 151B may be attached to the virtual computeinstance 141D. In one embodiment, the elastic graphics service 110 mayinteract with one or more other services or functionalities of aprovider network 100, such as a compute virtualization functionality 140and/or GPU virtualization functionality 150, to attach the virtual GPU151B to the instance 141D. The virtual compute instance 141D may beimplemented using central processing unit (CPU) resources and memoryresources of a physical compute instance 142C. The virtual GPU 151B maybe implemented using a physical GPU 152B. The physical GPU 152B may beattached to a different computing device than the computing device 142Cthat provides the CPU resources for the virtual compute instance 141D.The physical GPU 152B may be accessible to the physical compute instance142C over a network. The virtual GPU 151B may be said to be attached tothe virtual compute instance 141D, or the virtual compute instance 141Dmay be said to include the virtual GPU 151B. In one embodiment, thephysical GPU 152B may be shared between the virtual GPU 151B and one ormore additional virtual GPUs, and the additional virtual GPUs may beattached to additional virtual compute instances. In one embodiment, thevirtual GPU 151B may be accessible to the virtual compute instance 141Dvia an interface device that includes a network interface and a customhardware interface. Via the custom hardware interface, the interfacedevice may emulate a GPU and appear to the virtual compute instance 141Dto include the virtual GPU 151B. Via the network interface, theinterface device may communicate with the physical GPU 152B over thenetwork.

Graphics processing for the virtual compute instance 141D may bemigrated from the local GPU 941 to the remotely located virtual GPU151B. Migration of graphics processing may represent replacing thegraphics processing provided by the local GPU 941 with the graphicsprocessing provided by the virtual GPU 151B with respect to one or moreapplications. Graphics processing may include the execution ofinstructions on a GPU, often to produce graphical output based on input.Migration of graphics processing may include discontinuing use of thelocal GPU 941 for graphics processing and initiating use of the virtualGPU 151B for graphics processing with respect to one or moreapplications. In some circumstances, the migration may be performed at atime when no applications are using the local GPU 941. More typically,the migration may be initiated during execution of one or moreapplications and while the application(s) are using the local GPU 941.In one embodiment, the graphics processing may be migrated from thelocal GPU 941 to the virtual GPU 151B based (at least in part) on theincrease in the graphics workload. In one embodiment, thelocal-to-remote migration may be performed based (at least in part) forbusiness reasons, e.g., if a budget for a client is increased such thatthe cost of a virtual GPU can be justified for that client.

When applications are using the local GPU 941 when migration isinitiated, the migration may be referred to as live migration. Toimplement live migration, any currently running applications may bepaused, an interface of the application(s) to the local GPU 941 may bereplaced by an interface to the virtual GPU 151B, any graphicsinstructions and/or data may be transferred to the virtual GPU, and thenthe virtual GPU may be used to resume the graphics processing. In oneembodiment, a shim (such as an API shim) may keep track of graphicsresources (e.g., textures, render targets, and so on) that are used bythe source GPU. To perform the migration, those graphics resources maybe requested, copied via handles, and recreated on the target GPU. Thememory and execution stack may be synchronized between the source GPUand the target GPU; once the target GPU is caught up, the instance maybe paused to perform the migration. In one embodiment, input data may bebroadcast to the local GPU 941 as well as the virtual GPU 151B until thevirtual GPU is ready to take over graphics processing. In oneembodiment, the video memory on the local GPU 941 may be marked ascopy-on-write, the contents of video memory on the local GPU may betransferred to the virtual GPU 151B, and then the “dirty” regions in thememory on the local GPU may be updated on the virtual GPU.

As discussed above with respect to FIG. 3, any suitable technique(s) maybe used to offload graphics processing from a virtual compute instanceto a virtual GPU on a different computing device. In one embodiment, anAPI shim may intercept calls to a graphics API and marshal the calls toan interface device that implements the local GPU. Within the interfacedevice or at the API shim level, an interface to the local GPU 941 maybe replaced by an interface to the virtual GPU 151B such that thegraphics processing is migrated seamlessly and transparently withrespect to the application(s), e.g., without needing to modify orrelaunch the application(s). In one embodiment, a hardware shim maysurface a hardware interface to the virtual compute instance and marshalattempts by the instance to interact with the local GPU.

The physical compute instance 142C and physical GPU 152B may be locatedin the same rack, in different racks in the same data center, indifferent data centers, in different availability zones or regions, orin any other locations relative to one another. In one embodiment,migration of the virtual compute instance to a different virtual computeinstance may also be performed along with local-to-remote migration ofgraphics processing. Migration of the virtual compute instance may beperformed to move to an underlying physical compute instance that iscloser to the selected virtual GPU, e.g., such that the physical computeinstance 142C and physical GPU 152B are in the same rack or otherwise innearby locations in the same data center. Any suitable heuristic(s) maybe used to determine whether to migrate the virtual compute instanceand/or to select the placement of the destination physical computeinstance. For example, the migration of the virtual compute instance maybe performed to reduce network latency associated with virtualizedgraphics processing and/or to reduce usage of a network for virtualizedgraphics processing. Migration of the instance may include livemigration, such that one or more applications executing on the virtualcompute instance may be paused on the source instance and then resumedon the destination instance.

FIG. 10 is a flowchart illustrating a method for local-to-remotemigration of graphics processing from a local GPU to a virtual GPU,according to one embodiment. As shown in 1005, a virtual computeinstance may be provisioned from a multi-tenant provider network. Themulti-tenant provider network may include a plurality of computingdevices configured to implement a plurality of virtual computeinstances. The virtual compute instance may include a local graphicsprocessing unit (GPU). The provisioned instance may be of an instancetype that includes the local GPU in a default configuration. In oneembodiment, the local GPU may be implemented as a hardware component ofthe physical compute instance used to implement the virtual computeinstance. For example, the local GPU may be implemented using thenetwork-capable, customizable interface device 410 shown in FIG. 4.Alternatively, the local GPU may be implemented using a physical GPUinstalled in the physical compute instance. In one embodiment, the localGPU may be implemented in software using emulation techniques.Typically, the local GPU may provide a low level of graphics processingcapabilities in comparison to the virtual GPUs available through anelastic graphics service of the provider network.

Turning back to FIG. 10, the virtual compute instance may be used toexecute one or more applications. At least one of the applications mayuse the local GPU, e.g., for graphics processing. As shown in 1010, achange in graphics workload for the local GPU may be determined duringthe use of the virtual compute instance. The change in graphics workloadmay be determined based on user input or automatically detected based onprogrammatic monitoring. For example, a user may indicate that thegraphics workload is expected to change for a currently runningapplication or due to an application that will be added to the instance;the user-supplied indication may include a general request for a morecapable virtual GPU or an identification of a specific class of virtualGPU. An automatically detected change in the graphics workload may bebased on any suitable metrics relating to use of a GPU, such as thenumber of primitives sent to the GPU, the number of operations requestedof the GPU, the video memory used by the GPU, and/or the rate of outputfrom the GPU over a period of time. The detected change may typicallyrepresent an increase in graphics workload, e.g., an increase beyond thegraphics capabilities of the local GPU. For example, if the applicationis using the local GPU to produce full-screen 2D or 3D graphics, thegraphics workload may increase such that the frames per second (fps)decreases below a threshold of acceptable performance. As anotherexample, the aggregate graphics workload generated by multipleapplications may push the local GPU beyond a threshold of acceptableperformance as additional applications are executed simultaneously. Anysuitable techniques may be used for monitoring of the graphics workloadand detecting a change therein, and any suitable thresholds may be usedto assess when the graphics workload has increased sufficiently tojustify the attachment of a virtual GPU. If a change in the graphicsworkload is determined, then the method may proceed to the operationshown in 1015.

As shown in 1015, a virtual GPU may be selected for use with the virtualcompute instance, e.g., to replace or supplement the use of the localGPU. The virtual GPU may be selected from a set of virtual GPU classeshaving different graphics processing capabilities. The virtual GPU maybe selected to match the current or anticipated graphics workload of thevirtual compute instance. Accordingly, the selected virtual GPU may beof a class that is capable of handling the graphics workload with anacceptable level of performance. In one embodiment, the elastic graphicsservice may store benchmarks or other metrics for each class of virtualGPU to indicate the graphics processing capabilities relative to variouslevels of graphics workload. In one embodiment, the virtual GPU may beselected not based on a detected change in the graphics workload but ona configuration change requested by or enabled by a user of the virtualcompute instance. For example, if a new application is added to thevirtual compute instance during its use, an application manifest for thenew application may require greater GPU performance than the instancecurrently provides (e.g., with the local GPU).

The selected virtual GPU may be attached to the virtual computeinstance. In one embodiment, the elastic graphics service may interactwith one or more other services or functionalities of a providernetwork, such as a compute virtualization functionality and/or GPUvirtualization functionality, to attach the virtual GPU to the instance.The virtual compute instance may be implemented using central processingunit (CPU) resources and memory resources of a physical computeinstance. The virtual GPU may be implemented using a physical GPU. Thephysical GPU may be attached to a different computing device than thecomputing device that provides the CPU resources for the virtual computeinstance. The physical GPU may be accessible to the physical computeinstance over a network. The virtual GPU may be said to be attached tothe virtual compute instance, or the virtual compute instance may besaid to include the virtual GPU. In one embodiment, the physical GPU maybe shared between the virtual GPU and one or more additional virtualGPUs, and the additional virtual GPUs may be attached to additionalvirtual compute instances. In one embodiment, the virtual GPU may beaccessible to the virtual compute instance via an interface device thatincludes a network interface and a custom hardware interface. Via thecustom hardware interface, the interface device may emulate a GPU andappear to the virtual compute instance to include the virtual GPU. Viathe network interface, the interface device may communicate with thephysical GPU over the network.

As shown in 1020, graphics processing for the virtual compute instancemay be migrated from the local GPU to the remote virtual GPU. Migrationof graphics processing may represent replacing the graphics processingprovided by the local GPU with the graphics processing provided by thevirtual GPU with respect to one or more applications. Graphicsprocessing may include the execution of instructions on a GPU, often toproduce graphical output based on input. Migration of graphicsprocessing may include discontinuing use of the local GPU for graphicsprocessing and initiating use of the virtual GPU for graphics processingwith respect to one or more applications. In some circumstances, themigration may be performed at a time when no applications are using thelocal GPU. More typically, the migration may be initiated duringexecution of one or more applications and while the application(s) areusing the local GPU. In one embodiment, the graphics processing may bemigrated from the local GPU to the virtual GPU based (at least in part)on the increase in the graphics workload.

When applications are using the local GPU when migration to the remoteGPU is initiated, the migration may be referred to as live migration. Toimplement live migration, any currently running applications may bepaused, an interface of the application(s) to the local GPU may bereplaced by an interface to the virtual GPU, any graphics instructionsand/or data may be transferred to the virtual GPU, and then the virtualGPU may be used to resume the graphics processing. As discussed abovewith respect to FIG. 3, any suitable technique(s) may be used to offloadgraphics processing from a virtual compute instance to a virtual GPU ona different computing device. For example, an API shim may interceptcalls to a graphics API and marshal the calls to an interface devicethat implements the local GPU. Within the interface device or at the APIshim level, an interface to the local GPU may be replaced by aninterface to the virtual GPU such that the graphics processing ismigrated seamlessly and transparently with respect to theapplication(s), e.g., without needing to modify or relaunch theapplication(s).

Turning back to FIG. 10, as shown in 1025, the application may beexecuted on the virtual compute instance using the virtual GPU.Execution of the application may include execution of instructions onthe virtual compute instance (e.g., on the underlying physical computeinstance) and/or virtual GPU (e.g., on the underlying physical GPU).Execution of the application using the virtual GPU may generate virtualGPU output, e.g., output produced by executing instructions or otherwiseperforming tasks on the virtual GPU. The techniques described herein formigration for virtualized graphics processing may be used with thetechniques described herein for application-specific virtualizedgraphics processing. Accordingly, additional applications on the virtualcompute instance may use different (e.g., application-specific) virtualGPUs and/or the local GPU, and the application-specific virtual GPUsand/or local GPU may vary in graphics processing capabilities based onthe varying requirements of the applications.

As shown in 1030, the virtual GPU output may be provided to a clientdevice. The virtual GPU output may be provided to the client device fromthe virtual compute instance or virtual GPU. In one embodiment, thevirtual GPU output may be displayed on a display device associated withthe client device. The virtual GPU output may include pixel informationor other graphical data that is displayed on the display device.Execution of the application using the virtual GPU may include graphicsprocessing (e.g., acceleration of three-dimensional graphics processing)for the application using a graphics API.

Illustrative Computer System

In at least some embodiments, a computer system that implements aportion or all of one or more of the technologies described herein mayinclude a computer system that includes or is configured to access oneor more computer-readable media. FIG. 11 illustrates such a computingdevice 3000. In the illustrated embodiment, computing device 3000includes one or more processors 3010 coupled to a system memory 3020 viaan input/output (I/O) interface 3030. Computing device 3000 furtherincludes a network interface 3040 coupled to I/O interface 3030.

In various embodiments, computing device 3000 may be a uniprocessorsystem including one processor 3010 or a multiprocessor system includingseveral processors 3010 (e.g., two, four, eight, or another suitablenumber). Processors 3010 may include any suitable processors capable ofexecuting instructions. For example, in various embodiments, processors3010 may be processors implementing any of a variety of instruction setarchitectures (ISAs), such as the x86, PowerPC, SPARC, or MIPS ISAs, orany other suitable ISA. In multiprocessor systems, each of processors3010 may commonly, but not necessarily, implement the same ISA.

System memory 3020 may be configured to store program instructions anddata accessible by processor(s) 3010. In various embodiments, systemmemory 3020 may be implemented using any suitable memory technology,such as static random access memory (SRAM), synchronous dynamic RAM(SDRAM), nonvolatile/Flash-type memory, or any other type of memory. Inthe illustrated embodiment, program instructions and data implementingone or more desired functions, such as those methods, techniques, anddata described above, are shown stored within system memory 3020 as code(i.e., program instructions) 3025 and data 3026.

In one embodiment, I/O interface 3030 may be configured to coordinateI/O traffic between processor 3010, system memory 3020, and anyperipheral devices in the device, including network interface 3040 orother peripheral interfaces. In some embodiments, I/O interface 3030 mayperform any necessary protocol, timing or other data transformations toconvert data signals from one component (e.g., system memory 3020) intoa format suitable for use by another component (e.g., processor 3010).In some embodiments, I/O interface 3030 may include support for devicesattached through various types of peripheral buses, such as a variant ofthe Peripheral Component Interconnect (PCI) bus standard or theUniversal Serial Bus (USB) standard, for example. In some embodiments,the function of I/O interface 3030 may be split into two or moreseparate components, such as a north bridge and a south bridge, forexample. Also, in some embodiments some or all of the functionality ofI/O interface 3030, such as an interface to system memory 3020, may beincorporated directly into processor 3010.

Network interface 3040 may be configured to allow data to be exchangedbetween computing device 3000 and other devices 3060 attached to anetwork or networks 3050. In various embodiments, network interface 3040may support communication via any suitable wired or wireless generaldata networks, such as types of Ethernet network, for example.Additionally, network interface 3040 may support communication viatelecommunications/telephony networks such as analog voice networks ordigital fiber communications networks, via storage area networks such asFibre Channel SANs, or via any other suitable type of network and/orprotocol.

In some embodiments, system memory 3020 may be one embodiment of acomputer-readable (i.e., computer-accessible) medium configured to storeprogram instructions and data as described above for implementingembodiments of the corresponding methods and apparatus. However, inother embodiments, program instructions and/or data may be received,sent or stored upon different types of computer-readable media.Generally speaking, a computer-readable medium may includenon-transitory storage media or memory media such as magnetic or opticalmedia, e.g., disk or DVD/CD coupled to computing device 3000 via I/Ointerface 3030. A non-transitory computer-readable storage medium mayalso include any volatile or non-volatile media such as RAM (e.g. SDRAM,DDR SDRAM, RDRAM, SRAM, etc.), ROM, etc., that may be included in someembodiments of computing device 3000 as system memory 3020 or anothertype of memory. Further, a computer-readable medium may includetransmission media or signals such as electrical, electromagnetic, ordigital signals, conveyed via a communication medium such as a networkand/or a wireless link, such as may be implemented via network interface3040. Portions or all of multiple computing devices such as thatillustrated in FIG. 11 may be used to implement the describedfunctionality in various embodiments; for example, software componentsrunning on a variety of different devices and servers may collaborate toprovide the functionality. In some embodiments, portions of thedescribed functionality may be implemented using storage devices,network devices, or various types of computer systems. The term“computing device,” as used herein, refers to at least all these typesof devices, and is not limited to these types of devices.

The various methods as illustrated in the Figures and described hereinrepresent examples of embodiments of methods. The methods may beimplemented in software, hardware, or a combination thereof. In variousones of the methods, the order of the steps may be changed, and variouselements may be added, reordered, combined, omitted, modified, etc.Various ones of the steps may be performed automatically (e.g., withoutbeing directly prompted by user input) and/or programmatically (e.g.,according to program instructions).

The terminology used in the description of the invention herein is forthe purpose of describing particular embodiments only and is notintended to be limiting of the invention. As used in the description ofthe invention and the appended claims, the singular forms “a”, “an” and“the” are intended to include the plural forms as well, unless thecontext clearly indicates otherwise. It will also be understood that theterm “and/or” as used herein refers to and encompasses any and allpossible combinations of one or more of the associated listed items. Itwill be further understood that the terms “includes,” “including,”“comprises,” and/or “comprising,” when used in this specification,specify the presence of stated features, integers, steps, operations,elements, and/or components, but do not preclude the presence oraddition of one or more other features, integers, steps, operations,elements, components, and/or groups thereof

As used herein, the term “if” may be construed to mean “when” or “upon”or “in response to determining” or “in response to detecting,” dependingon the context. Similarly, the phrase “if it is determined” or “if [astated condition or event] is detected” may be construed to mean “upondetermining” or “in response to determining” or “upon detecting [thestated condition or event]” or “in response to detecting [the statedcondition or event],” depending on the context.

It will also be understood that, although the terms first, second, etc.,may be used herein to describe various elements, these elements shouldnot be limited by these terms. These terms are only used to distinguishone element from another. For example, a first contact could be termed asecond contact, and, similarly, a second contact could be termed a firstcontact, without departing from the scope of the present invention. Thefirst contact and the second contact are both contacts, but they are notthe same contact.

Numerous specific details are set forth herein to provide a thoroughunderstanding of claimed subject matter. However, it will be understoodby those skilled in the art that claimed subject matter may be practicedwithout these specific details. In other instances, methods, apparatus,or systems that would be known by one of ordinary skill have not beendescribed in detail so as not to obscure claimed subject matter. Variousmodifications and changes may be made as would be obvious to a personskilled in the art having the benefit of this disclosure. It is intendedto embrace all such modifications and changes and, accordingly, theabove description is to be regarded in an illustrative rather than arestrictive sense.

What is claimed is:
 1. A system, comprising: a virtual compute instance,wherein the virtual compute instance is implemented using centralprocessing unit (CPU) resources and memory resources of a physicalcompute instance, wherein the virtual compute instance is provided by amulti-tenant provider network, and wherein the virtual compute instanceis configured to execute an application; a physical graphics processingunit (GPU) accessible to the virtual compute instance over a network;one or more computing devices configured to implement an elasticgraphics service, wherein the elastic graphics service is configured to:attach a virtual GPU to the virtual compute instance, wherein thevirtual GPU is selected from a plurality of virtual GPU classes based atleast in part on requirements for the application, and wherein thevirtual GPU is implemented using the physical GPU; wherein the virtualcompute instance is configured to: execute the application using thevirtual GPU, wherein execution of the application generates output, andwherein the output is displayed on a display device associated with aclient device.
 2. The system as recited in claim 1, wherein therequirements for the application are specified in an applicationmanifest associated with the application.
 3. The system as recited inclaim 1, wherein the requirements for the application are determinedduring runtime of the application.
 4. The system as recited in claim 1,wherein the virtual compute instance is configured to execute anadditional application, and wherein the elastic graphics service isconfigured to: attach an additional virtual GPU to the virtual computeinstance, wherein the additional virtual GPU is selected from theplurality of virtual GPU classes based at least in part on requirementsfor the additional application; wherein the virtual compute instance isconfigured to: execute the additional application using the additionalvirtual GPU while executing the application using the virtual GPU.
 5. Acomputer-implemented method, comprising: provisioning a virtual computeinstance from a multi-tenant provider network, wherein the multi-tenantprovider network comprises a plurality of computing devices configuredto implement a plurality of virtual compute instances; attaching avirtual graphics processing unit (GPU) to the virtual compute instance,wherein the virtual GPU is selected based at least in part on anapplication, wherein the virtual GPU is implemented using a physicalGPU, and wherein the physical GPU is accessible to the virtual computeinstance over a network; and executing the application using the virtualGPU on the virtual compute instance.
 6. The method as recited in claim5, wherein the virtual GPU is selected based at least in part onrequirements for the application, and wherein the requirements for theapplication are specified in an application manifest associated with theapplication.
 7. The method as recited in claim 5, wherein the virtualGPU is selected based at least in part on a recommended virtual GPUclass for the application, and wherein the recommended virtual GPU classis specified in an application manifest associated with the application.8. The method as recited in claim 5, wherein the virtual GPU is selectedbased at least in part on requirements for the application, and whereinthe requirements for the application are determined during runtime ofthe application.
 9. The method as recited in claim 5, wherein thevirtual GPU is selected based at least in part on requirements for theapplication, and wherein the requirements for the application aredetermined using an execution history of the application.
 10. The methodas recited in claim 5, further comprising: attaching an additionalvirtual graphics processing unit (GPU) to the virtual compute instance,wherein the additional virtual GPU is selected based at least in part onan additional application; and executing the additional applicationusing the additional virtual GPU on the virtual compute instance whileexecuting the application using the virtual GPU on the virtual computeinstance.
 11. The method as recited in claim 5, further comprising:executing an additional application on the virtual compute instancewithout using the virtual GPU while executing the application using thevirtual GPU on the virtual compute instance.
 12. The method as recitedin claim 5, further comprising: selecting a virtual GPU class for thevirtual GPU from a plurality of virtual GPU classes, wherein the virtualGPU classes vary in respective computational resources or memoryresources, and wherein the virtual GPU class is selected based at leastin part on requirements for the application and the respectivecomputational resources or memory resources provided by the virtual GPUclass.
 13. A computer-readable storage medium storing programinstructions computer-executable to perform: selecting a virtual computeinstance, wherein the virtual compute instance is selected based atleast in part on resources provided by the virtual compute instance, andwherein the virtual compute instance is configured to execute anapplication; selecting a virtual graphics processing unit (GPU), whereinthe virtual GPU is selected based at least in part on requirementsassociated with the application; and provisioning the virtual computeinstance comprising the virtual GPU, wherein the virtual computeinstance is implemented using resources of a physical compute instance,wherein the virtual GPU is implemented using a physical GPU, and whereinthe physical GPU is accessible to the physical compute instance over anetwork.
 14. The computer-readable storage medium as recited in claim13, and wherein the requirements associated with the application arespecified in an application manifest associated with the application.15. The computer-readable storage medium as recited in claim 13, whereinthe requirements associated with the application comprise a recommendedvirtual GPU class for the application, and wherein the recommendedvirtual GPU class is specified in an application manifest associatedwith the application.
 16. The computer-readable storage medium asrecited in claim 13, wherein the requirements associated with theapplication are determined using runtime analysis of the application.17. The computer-readable storage medium as recited in claim 13, whereinthe requirements associated with the application are determined using anexecution history of the application.
 18. The computer-readable storagemedium as recited in claim 13, wherein the program instructions arefurther computer-executable to perform: attaching an additional virtualgraphics processing unit (GPU) to the virtual compute instance, whereinthe additional virtual GPU is selected based at least in part onrequirements associated with an additional application; and executingthe additional application using the additional virtual GPU on thevirtual compute instance while executing the application using thevirtual GPU on the virtual compute instance.
 19. The computer-readablestorage medium as recited in claim 13, wherein the program instructionsare further computer-executable to perform: executing an additionalapplication on the virtual compute instance without using the virtualGPU while executing the application using the virtual GPU on the virtualcompute instance.
 20. The computer-readable storage medium as recited inclaim 13, wherein the program instructions are furthercomputer-executable to perform: selecting a virtual GPU class for thevirtual GPU from a plurality of virtual GPU classes, wherein the virtualGPU classes vary in respective computational resources or memoryresources, and wherein the virtual GPU class is selected based at leastin part on the requirements associated with the application and therespective computational resources or memory resources provided by thevirtual GPU class.